package com.vastcom.sigma.admin.action;


import com.vastcom.sigma.admin.model.Bakerecord;
import com.vastcom.sigma.admin.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@CrossOrigin
@RestController
@RequestMapping("/public")

public class publicAction {

    @Autowired
    private ManageService manageService;

    @PostMapping("test")
    @ResponseBody
    public HashMap test(@RequestBody Bakerecord bakerecord) {
        HashMap hashMap = new HashMap();

        try {
            Bakerecord bakerecordByid = manageService.getBakerecordByid(bakerecord.getBakerecordid());
            hashMap.put("msg","ok");
            hashMap.put("obj",bakerecordByid);
        } catch (Exception e) {
            e.printStackTrace();
        }


        return hashMap;
    }


}
